package com.ruoyi.bantong.controller;

import com.ruoyi.bantong.domain.BtArticle;
import com.ruoyi.bantong.service.IBtArticleService;
import com.ruoyi.bantong.service.IBtUserAccountRecordService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * 后台首页Controller
 * 
 * @author laohei
 * @date 2021-01-24
 */
@RestController
public class BtAdminMainController extends BaseController
{
    @Autowired
    private IBtUserAccountRecordService btUserAccountRecordService;

    /**
     * 后台主页数据
     */
    //@PreAuthorize("@ss.hasPermi('bantong:record:list')")
    @GetMapping("/mainData")
    public AjaxResult mainDate()
    {
        return AjaxResult.success(btUserAccountRecordService.selectMainData());
    }

    /**
     * 后台主页数据
     */
    //@PreAuthorize("@ss.hasPermi('bantong:record:list')")
    @GetMapping("/mainDataList")
    public TableDataInfo mainDataList()
    {
        startPage();
        List<Map<String, Object>> list = btUserAccountRecordService.selectListOrderByDay();
        return getDataTable(list);
    }
}
